package org.kl.bpm.entity.conf;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.kl.bf.entity.Excel;
import org.kl.bf.entity.IdEntity;
import org.kl.bf.entity.basic.User;

import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 
 * @Author hqm
 * @CreateTime 2014年5月25日 下午7:47:01
 */
@Entity
@Table(name = "BPM_DELEGATE_HISTORY")
public class BpmDelegateHistory extends IdEntity {
	private static final long serialVersionUID = 0L;
	@Excel(exportName = "委托人")
	private User assignee;
	@Excel(exportName = "被委托人")
	private User attorney;
	@Excel(exportName = "委托时间")
	private Date delegateTime;
	@Excel(exportName = "任务ID")
	private String taskId;
	@Excel(exportName = "任务定义KEY")
	private String taskDefinitionKey;
	@Excel(exportName = "流程实例ID")
	private String processInstanceId;
	@Excel(exportName = "流程定义ID")
	private String processDefinitionId;
	@Excel(exportName = "状态")
	private Integer status;

	public BpmDelegateHistory() {
	}

	public BpmDelegateHistory(User assignee, User attorney, Date delegateTime, String taskId, Integer status) {
		this.assignee = assignee;
		this.attorney = attorney;
		this.delegateTime = delegateTime;
		this.taskId = taskId;
		this.status = status;
	}

	@OneToOne
	@JoinColumn(name = "assignee")
	public User getAssignee() {
		return this.assignee;
	}

	/**
	 * @param assignee
	 *            null.
	 */
	public void setAssignee(User assignee) {
		this.assignee = assignee;
	}

	/** @return null. */
	@OneToOne
	@JoinColumn(name = "attorney")
	public User getAttorney() {
		return this.attorney;
	}

	/**
	 * @param attorney
	 *            null.
	 */
	public void setAttorney(User attorney) {
		this.attorney = attorney;
	}

	/** @return null. */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "DELEGATE_TIME", length = 26)
	// 设定JSON序列化时的日期格式
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	public Date getDelegateTime() {
		return this.delegateTime;
	}

	/**
	 * @param delegateTime
	 *            null.
	 */
	public void setDelegateTime(Date delegateTime) {
		this.delegateTime = delegateTime;
	}

	/** @return null. */
	@Column(name = "TASK_ID", length = 100)
	public String getTaskId() {
		return this.taskId;
	}

	/**
	 * @param taskId
	 *            null.
	 */
	public void setTaskId(String taskId) {
		this.taskId = taskId;
	}

	/** @return null. */
	@Column(name = "STATUS")
	public Integer getStatus() {
		return this.status;
	}

	/**
	 * @param status
	 *            null.
	 */
	public void setStatus(Integer status) {
		this.status = status;
	}

	public String getTaskDefinitionKey() {
		return taskDefinitionKey;
	}

	public void setTaskDefinitionKey(String taskDefinitionKey) {
		this.taskDefinitionKey = taskDefinitionKey;
	}

	public String getProcessInstanceId() {
		return processInstanceId;
	}

	public void setProcessInstanceId(String processInstanceId) {
		this.processInstanceId = processInstanceId;
	}

	public String getProcessDefinitionId() {
		return processDefinitionId;
	}

	public void setProcessDefinitionId(String processDefinitionId) {
		this.processDefinitionId = processDefinitionId;
	}

}
